//
//  WBVisiterView.swift
//  陌路微博
//
//  Created by 张继强 on 16/12/5.
//  Copyright © 2016年 张继强. All rights reserved.
//

import UIKit
import SnapKit

class WBVisiterView: UIView {
    //图像视图
    fileprivate lazy var iconView:UIImageView = UIImageView.init(image:UIImage.init(named: "visitordiscover_feed_image_smallicon"))
    //小房子
    fileprivate lazy var houseIconView:UIImageView = UIImageView.init(image: UIImage.init(named: "visitordiscover_feed_image_house"))
    //提示标签
    fileprivate lazy var tipLabel:UILabel = UILabel.cz_label(
        withText: "关注一些人,回这里看看有什么惊喜关注一些人，回这里看看有什么惊喜"
        , fontSize: 16
        , color: UIColor.darkGray)
    //注册按钮
    fileprivate lazy var registerButton:UIButton  = UIButton.cz_textButton("注册"
        , fontSize: 16
        , normalColor: .orange,
          highlightedColor: .darkGray,
          backgroundImageName: "common_button_white_disable")
    
    //登录按钮
    fileprivate lazy var loginButton:UIButton  = UIButton.cz_textButton("登录"
        , fontSize: 16
        , normalColor: .darkGray,
          highlightedColor: .orange,
          backgroundImageName: "common_button_white_disable")
    fileprivate lazy var maskIconView:UIImageView = UIImageView.init(image: UIImage.init(named: "visitordiscover_feed_mask_smallicon"))
    //设置界面
    override init(frame: CGRect) {
        super.init(frame: frame)
//        self.backgroundColor = UIColor.init(colorLiteralRed: 246/255.0, green: 246/255.0, blue: 246/255.0, alpha: 1)
        self.setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}
extension WBVisiterView{
    //设置界面
    func setupUI(){
        self.addSubview(self.iconView)
        self.addSubview(maskIconView)
        self.addSubview(self.houseIconView)
        self.addSubview(self.tipLabel)
        self.addSubview(self.registerButton)
        self.addSubview(self.loginButton)
        self.iconView.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.center.x)
            make.centerY.equalTo(self.center.y-30)
            make.size.equalTo(CGSize.init(width: 188, height: 180))
        }
        self.houseIconView.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.center.x)
            make.centerY.equalTo(self.center.y-30)
            make.size.equalTo(CGSize.init(width: 94, height: 90))
        }
        self.tipLabel.snp.makeConstraints { (make) in
            make.top.equalTo(self.iconView.snp.bottom).offset(0)
            make.left.equalTo(60)
            make.right.equalTo(-60)
            make.height.equalTo(40)
        }
        self.tipLabel.numberOfLines = 0
        self.tipLabel.textAlignment = .center
        self.tipLabel.font = UIFont.systemFont(ofSize: 15)
        self.registerButton.snp.makeConstraints { (make) in
            make.left.equalTo(self.tipLabel.snp.left)
            make.height.equalTo(40)
            make.top.equalTo(self.tipLabel.snp.bottom).offset(10)
            make.width.equalTo(90)
        }
        self.loginButton.snp.makeConstraints { (make) in
            make.right.equalTo(self.tipLabel.snp.right)
            make.height.equalTo(40)
            make.width.equalTo(90)
            make.top.equalTo(self.registerButton)
        }
        self.maskIconView.snp.makeConstraints { (make) in
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.bottom.equalTo(self.registerButton.snp.top).offset(0)
            make.top.equalTo(0)
        }
    }
}
